package com.yaha.controler.devices.pojo;

import com.yaha.controler.remote.OtODeviceAdapter;

public class MdnsDevice extends Device {
	private String mUUID = "12345678";
	public static final int TTL_DEVICE = 37 * 1000;
	/**
	 * 生存时间，单位：毫秒.
	 */
	private int mTTL;
	/**
	 * 创建时间，单位：毫秒.
	 */
	private long mCreatedTime;

	private OtODeviceAdapter mAdapter;

	public MdnsDevice(String name, String ip, String mac, boolean isDvb, String model, String hardware) {
		super(name, ip, mac);
		this.setMdns(true);
		this.setmTTL(TTL_DEVICE);
		this.setmCreatedTime(System.currentTimeMillis());
		this.setDvb(isDvb);
		this.setModel(model);
		this.setHardware(hardware);
	}

	/**
	 * <功能描述>实例化键值适配器对象
	 * 
	 * @return
	 */
	public OtODeviceAdapter adapter() {
		if (mAdapter == null) {
			mAdapter = OtODeviceAdapter.create();
		}
		return mAdapter;
	}

	public String getmUUID() {
		return mUUID;
	}

	public void setmUUID(String mUUID) {
		this.mUUID = mUUID;
	}

	public int getmTTL() {
		return mTTL;
	}

	public void setmTTL(int mTTL) {
		this.mTTL = mTTL;
	}

	public long getmCreatedTime() {
		return mCreatedTime;
	}

	public void setmCreatedTime(long mCreatedTime) {
		this.mCreatedTime = mCreatedTime;
	}
}
